import { getSession } from "../../../../utils/common";
import { postMethod, getMethod } from "../../../../utils/http";

export async function getList(schoolId, current, tagId) {
    return await postMethod(`xyxy/wxapp/web/blog/blogList`, {
        params: {
            schoolId,
            current,
            tagId,
        }
    });
}
export async function dummyStudentList() {
    return await postMethod(`xyxy/wxapp/web/user/list`, {
        params: {
           
        }
    });
}
export async function getSchoolList() {
    return await postMethod(`xyxy/wxapp/web/school/list`, {});
}


export async function add(data = {}) {
    return await postMethod(`xyxy/wxapp/web/blog/save`, {
        params: {
            ...data,
        }
    });
}

export async function queryItem(id) {
    return await postMethod(`xyxy/wxapp/web/blog/view?id=${id}`, {});
}

export async function edit(data) {
    return await postMethod(`xyxy/wxapp/web/blog/update`, {
        params: {
            ...data,
        }
    });
}

export async function del(id) {
    return await postMethod(`xyxy/wxapp/web/blog/delete?id=${id}`, {

    });
}

// 话题列表
export async function topicList(schoolId=getSession('user-info')==0?'0':JSON.parse(getSession('user-info')).id) {
    return await postMethod(`xyxy/wxapp/web/blog/tagList?schoolId=${schoolId}`, {});
}

